clear all
close all
clc

load('lab1_Y_data.mat')
load('lab1_LYyx_data.mat')

actual = lab1_data(:,1);
glenn = lab1_data(:,2);
ali = lab1_data(:,3);

figure 

hold on
plot([0,80],[0,80],'k', 'LineWidth', 1.5)
plot(actual,glenn,'r', 'LineWidth', 2.5)
plot(actual,ali,'b', 'LineWidth', 2.5)
title('Actual vs. Observed Y Value')
xlabel('Actual Y')
ylabel('Observed Y')
axis([0 80 0 80])
legend('1:1','Glenn', 'Ali', 'Location', 'NorthWest')
grid on
hold off

print('-depsc', 'Yvalue_comp.eps')

L = lab1_data2(:,1);
Y = lab1_data2(:,2);
x = lab1_data2(:,3);
y = lab1_data2(:,4);

figure 

hold on
plot(L,Y,'k', 'LineWidth', 2)
xlabel('L')
ylabel('Y')
title('Luminance vs. Y')
axis([0 100 0 80])
grid on
hold off

print('-depsc', 'L_versus_Y.eps')

figure 

hold on
plot(L,x,':or', 'MarkerSize', 6, 'MarkerFaceColor', 'r','MarkerEdgeColor','k')
plot(L,y,':ob', 'MarkerSize', 6, 'MarkerFaceColor', 'b','MarkerEdgeColor','k')
% scatter(L,x,10,'r','filled')
% scatter(L,y,10,'b','filled')
xlabel('L')
ylabel('chromaticity value')
title('Luminance vs. xy Chromaticities')
axis([0 100 0 0.5])
legend('x','y','Location','SouthEast')
grid on
hold off

print('-depsc', 'L_versus_xy.eps')
